package com.example.mysql.subscribe.listener;

import com.example.mysql.debezium.framework.DebeziumConfigBuilder;
import com.example.mysql.debezium.framework.DebeziumEngineBean;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

import java.io.IOException;

@SpringBootApplication
public class Boot {

    public static void main(String[] args) throws IOException {
        SpringApplication.run(Boot.class, args);
    }

    @Bean
    public DebeziumEngineBean debeziumEngineBean() {
        DebeziumConfigBuilder builder = DebeziumConfigBuilder.create("localhost", 3306, "demo", "123456");
        builder.serverName("test-subscribe");
        builder.tableWhiteList("demo-test", "t_student");
        return new DebeziumEngineBean(builder.build().asProperties());
    }

}
